<?
include_once 'library.php';
?>
<!DOCTYPE html>
<html lang="ko">
<head>
<title>SK Communications A11Y Score Board</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- Bootstarap Version -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<link type="text/css" rel="stylesheet" href="bootstrap/css/bootstrap.css" />
<!-- //Bootstarap Version -->
<script type="text/javascript" src="js/common.js"></script>
<!-- Basic Style -->
<link type="text/css" rel="stylesheet" href="css/style.css" />
<!-- //Basic Style -->
</head>
<body>
<?
$table_name = "test_result";
$select_array = array("ip");
$condition = "1=1 ORDER BY idx desc";
$result = selectDB($table_name, $select_array, $condition);

$floor_array = array();
for($i=0; $i <= count($result); $i++){
	$floor = explode(".", $result[$i][0]);
	$floor = $floor[1];
	if($floor > 0 && $floor <= 20){
		array_push($floor_array, $floor);
	}
}
$floor_array = array_count_values($floor_array);
arsort($floor_array);
?>
<div id="wrap">
	<div class="contents">
		<div class="navWrap">
			<h3>SK Communications A11Y</h2></h3>
			<div class="navbar">
				<div class="navbar-inner">
					<div class="container">
						<ul class="nav">
							<li><a href="/tools/a11y/">홈</a></li>
							<li><a href="/tools/a11y/install.html">설치 가이드 &amp; 다운로드</a></li>
							<li><a href="/tools/a11y/score_check.php">점수 집계표</a></li>
							<li><a href="/tools/a11y/service.php">서비스별 평균 점수표</a></li>
							<li class="active"><a href="/tools/a11y/rank.php">사내 측정 횟수표</a></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<h4>사내 측정 횟수(층수별)</h4>
		<table class="table table-bordered" summary="이 표는 총 3열로 구성되어 있으며 1열은 순위, 2열은 층수, 3열은 횟수를 나타냅니다">
			<caption>층수별 체크 횟수 표</caption>
			<thead>
			<tr class="navbar-inner">
				<th scope="col">순위</th>
				<th scope="col">층수</th>
				<th scope="col">횟수</th>
			</tr>
			</thead>
			<tbody>
			<?
			$i = 1;
			foreach($floor_array as $key => $value){
				echo "<tr><td>".$i."</td><td>".$key."층</td><td>".$value."회</td></tr>";
				$i++;
			}
			?>
			</tbody>
		</table>
	</div>
</div>
<div class="footer">2013. SK Communications | UI Dev Team</div>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-39065309-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</body>
</html>
